package _base0to1;

import java.util.Arrays;

/**
 * 389. 找不同
 */
public class No389 {
    public char findTheDifference(String s, String t) {
        char[] sCharArray = s.toCharArray();
        char[] tCharArray = t.toCharArray();
        Arrays.sort(sCharArray);
        Arrays.sort(tCharArray);
        for (int i = 0; i < s.length(); i++) {
            if (sCharArray[i] != tCharArray[i]) return tCharArray[i];
        }
        return tCharArray[s.length()];
    }
}
